package com.yao.club.reposittory;

import com.yao.club.entity.dto.GoodsCollectRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsCollectRecordRepository extends JpaRepository<GoodsCollectRecord, Long> {
    /**
     * 根据商品ID和用户ID查询收藏记录
     */
    GoodsCollectRecord findByGoodsIdAndUserId(Long goodsId, Long userId);

    /**
     * 根据用户ID查询收藏的商品
     */
    List<GoodsCollectRecord> findByUserId(Long userId);
}
